<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
      pop删除最后一个元素
       push 末尾添加一个元素
       shift 删除第一个元素
       unshift 添加第一个元素
      */
      (function () {
        const plants = ['', 'b', 'c', 'd', 'e'];
        console.log(plants.pop());
        const count = plants.push('f');
        console.log(count);
        const count2 = plants.shift();
        console.log(count2);
        const count3 = plants.unshift('h');
        console.log(count3);
      })();
    </script>
  </body>
</html>
